<?
require_once("../config/dbconn.php");require_once("../config/usercls.php");require_once("../config/pagecls.php");
$sqlchk="select * from {$db_prefix}applyzmd where username='".$_SESSION['sys_username']."' and state=1";
	$rschk=$db->get_one($sqlchk);
	if ($rschk){
		
		$isbdzx=1;
		
	}
	else
	{
		$isbdzx=0;
	}
	
	
	
?>






<?
$sql="select * from {$db_prefix}users where id='".$_SESSION['sys_userid']."'";
$rs=$db->get_one($sql);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户订单</title>
<link rel="stylesheet" type="text/css" href="css/indexcss.css"/>
<link rel="stylesheet" type="text/css" href="css/middle.css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/cuntom.js"></script>
</head>

<body style=" background:url(sy_data/jhn.jpg) no-repeat;">
 <div class="top">
     <div class="logo">
          <div class="logo_l">
           <img src="sy_data/ava.png" width="254" height="79" />
          </div>
           <div class="logo_r">
               <span id="liveclock" style=" float:right; "></span>
            </div>
     </div>
     <div class="clera">
     </div>
     <div class="nav">
                <div class="index_banner">
                    <ul id="_menu">
                        <li menu="_aaa"><a class="index_a" href="javascript:void(0)" target="mainfrom">公告留言</a></li>
						  <dl style="left: 302.5px; top: 127px; position: absolute; display: none;" id="_aaa" class="index_select">
                            <dd>
											
					  <a target="mainfrom" href="sy.php">公告列表</a>
					  
							  
					  <a target="mainfrom" href="sy1.php">会员留言</a> 
							
					   <a target="mainfrom" href="sy2.php" >留言列表</a>
					   
						
                                        
                                 
                            </dd>
                        </dl>
                        
						
						<li menu="_bbb"><a class="index_a_ban" href="javascript:void(0)">资料管理</a></li>
                        <dl style="left: 302.5px; top: 127px; position: absolute; display: none;" id="_bbb" class="index_select">
                            <dd>
                            
								  <a target="mainfrom" href="info_view.php">资料查看</a>								  
										  
								  <a target="mainfrom" href="info_price.php">账户余额</a> 
										
								   <a target="mainfrom" href="info_pwd.php" >密码修改</a>
                                  
                                 
                            </dd>
                        </dl>
						
						
                        <li menu="_ccc"><a class="index_a_ban" href="javascript:void(0)" target="mainfrom">网络管理</a></li>
                        <dl style="left: 424.5px; top: 127px; position: absolute; display: none;" id="_ccc" class="index_select">
                            <dd>                           
                            <a target="mainfrom" href="nets_tjtree.php">推荐树</a>
                            <a target="mainfrom" href="nets_tj.php">推荐网</a>
                            <a target="mainfrom" href="nets_gltree.php">管理树</a>
                            <a target="mainfrom" href="nets_gl.php" >管理网</a>                   
                            </dd>
                        </dl>
						
						
						
					
						
						
						
                        <li menu="_ggg"><a class="index_a_ban" href="javascript:void(0)" target="mainfrom">业务管理<?=$rs['isbdzx']?></a></li>
                        <dl style="left: 546.5px; top: 127px; position: absolute; display: none;" id="_ggg" class="index_select">
                            <dd>
							<?php if($isbdzx==1){?>		
							
                                <a target="mainfrom" href="user_reg.php" >注册会员</a>
                                <a target="mainfrom" href="user_tj1.php" >注册的会员</a>
					
							<?php } ?>
								<a target="mainfrom" href="user_zmdlst.php">申请服务中心</a>
                                <a target="mainfrom" href="user_fhlst.php">内部提货申请</a>
                                
                            </dd>
                        </dl>
						
						
						
                        <li menu="_fff"><a class="index_a_ban" href="javascript:void(0)" target="mainfrom">财务管理</a></li>
                        <dl style="display: none" id="_fff" class="index_select">
							 <dd>
							<a target="mainfrom" href="huikuan_lst.php">汇款登记</a>
							<a target="mainfrom" href="wangyin_lst.php">网银充值</a> 
							<a target="mainfrom" href="tixian_auto.php">自动提现</a>
							<a target="mainfrom" href="tixian_lst.php">奖金提现</a>                         
							<a target="mainfrom" href="trans_bd.php" >奖金币转出</a>
							<a target="mainfrom" href="trans_zzdo.php" >内部转账</a>
							<a target="mainfrom" href="trans_zz.php" >转出记录</a>
							<a target="mainfrom" href="trans_zr.php" >转入记录</a>
							<a target="mainfrom" href="query_salary.php" >奖金列表</a>
							<a target="mainfrom" href="caiwu_lst.php" >财务记录</a>
							
							 </dd>
                        </dl>
						
						
						
						
                        <li menu="_ddd"><a class="index_a_ban" href="product_buy.php" target="mainfrom">商品选购</a></li>
                       
                        <li menu="_eee"><a class="index_a_ban" href="javascript:void(0)" target="mainfrom">订单管理</a></li>
                        <dl style="display: none" id="_eee" class="index_select">
                            <dd>
                            <a target="mainfrom" href="product_cart.php">购物车</a>
                             <a target="mainfrom" href="order_lst0.php">未支付</a>
                             <a target="mainfrom" href="order_lst1.php">已支付</a>
                            <a target="mainfrom" href="order_lst2.php">已发货</a>
                            <a target="mainfrom" href="order_lst3.php">已收货</a>
							<?php if($isbdzx==1){?>									
                                <a target="mainfrom" href="order_lst34.php" >用户订单</a>					
							<?php } ?>
                            </dd>
                        </dl>
                        
                        
                        
                        <li menu="_hhh"><a class="index_a" onclick="javascript:if(!confirm('确认退出！'))  return  false; " href="outsys.php" target="_parent">安全退出</a></li></ul>
                </div>
            </div>
            </div>
        <div class="middle">
                <!--
                  <iframe src="会员管理系统_files/sy.htm" id="mainfrom" name="mainfrom" scrolling="no" onload="iFrameHeight()" frameborder="0" height="432" width="100%">您的浏览器版本太低，请下载较新版本</iframe>-->
                  
                  
                   <div class="left float">
            <div class="left_top float">
                您好：<span>
                		<span id="Label1"><?=$rs['username']?> </span>
                     </span>
            </div>
            <div class="left_con float">
                <p>
                    <img src="sy_data/hyjb.png"><span>
                        <span id="Label2">会员等级：<?=$rs['rank']?>星会员</span>
						</span></p>


			 
				
                <p style="display: none">
                    <img src="sy_data/ztyj.png" width="16" height="15" /><span>直推业绩：3人</span></p>
                <p>
                    <img src="sy_data/zsr.png" width="16" height="15" /><span><span id="Label4">总奖金：<?=$rs['priceall']?></span></span></p>
                <p>
                    <img src="sy_data/jjye.png"><span><span id="Label5">报单币：<?=$rs['price']?></span></span></p>
                <p>
                    <img src="sy_data/hbye.png"><span><span id="Label6">股票：<?=$rs['gpprice']?></span></span></p>
                <p>
                    <img src="sy_data/cfxf.png"><span><span id="Label7">可用余额：<?=$rs['jjprice']?></span></span></p>
                <p style="display: none">
                    <img src="sy_data/xyj.png"><span>幸运奖(日/总)： 50/4000 </span>
                </p>
                <p style="display: none">
                    <img src="sy_data/xyj.png"><span>管理奖日封顶： 2000 </span>
                </p>
                <p style="display: none">
                    <img src="sy_data/wdyj.png"><span>未读消息：<a>0</a></span></p>
            </div>
          <?php if($rs['rank']>=1){?>							
				 <a class="zhuce_btn" href="user_sj.php?id=<?=$rs['id']?>&pageno=<?=$page->pageno?>" target="mainfrom">
                <img src="sy_data/zhuce_btn.png"></a>                 
				<?php } ?>
                
                
        </div>
        <div class="mid_middle float">
<!--            <div class="bill float">
                <img src="sy_data/bill_1.jpg"></div>
-->           



				<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="29" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td width="935" height="29" valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">已收货订单</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="71" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9"><table width="100%" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="13" valign="top">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="nowtable">
                <tr>
                  <td class="left_bt2">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td height="30"><table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="30" align="center" bgcolor="#f2f2f2" >订单编号</td>
                  <td align="center" bgcolor="#f2f2f2" >用户名</td>
                  <td align="center" bgcolor="#f2f2f2" >订单类型</td>
                  <td align="center" bgcolor="#f2f2f2" >市场金额</td>
                  <td align="center" bgcolor="#f2f2f2" >订单金额</td>
                  <td align="center" bgcolor="#f2f2f2" >折扣</td>
                  <td align="center" bgcolor="#f2f2f2" >实际金额</td>
               
                  <td align="center" bgcolor="#f2f2f2" >状态</td>
                  <td align="center" bgcolor="#f2f2f2" >订单时间</td>
               <!--   <td height="30" align="center" bgcolor="#f2f2f2" >操作</td>-->
                  </tr>
<?
$sql="select * from {$db_prefix}users where id='$id'";
$rs7=$db->get_one($sql);
?>
  <?
  $query='';
  if ($action=='query'){
  	
  }
  
  $sql="select count(id) as c  from {$db_prefix}orders where  fwzx='".$_SESSION['sys_username']."'";
  if ($query!='') $sql.=$query;
  $rs=$db->get_one($sql);
  $page=new pagecls(20,intval($rs['c']));
  $sql="select * from {$db_prefix}orders where  fwzx='".$_SESSION['sys_username']."'";
  if ($query!='') $sql.=$query;
  $sql.=" order by id desc limit {$page->pastnum},{$page->pagesize}";
  $result=$db->query($sql);
  while($rs=$db->fetch_array($result)){
  ?>
                <tr>
                  <td align="center"><?=$rs['id']?></td>
                  <td align="center"><?=$rs['username']?></td>
                  <td align="center"><? 
				  if($rs['type']==1) echo "零售订单";
				  elseif($rs['type']==2) echo "首购订单";
				  elseif($rs['type']==3) echo "补业绩订单";
				  elseif($rs['type']==4) echo "复消订单";
				  elseif($rs['type']==5) echo "提货订单";
				  ?></td>
                  <td align="center"><?=$rs['scprice']?> 美金                      </td>
                  <td align="center" ><?=$rs['price']?>
                    美金 </td>
                  <td align="center" ><? if($rs['zhekou']==10) echo "不打折";else echo $rs['zhekou']."折"?></td>
                  <td align="center" class="left_txt3" ><?=$rs['price']*$rs['zhekou']/10?>美金</td>
        
                  <td align="center" class="left_ts"><? if($rs['state']==0) echo "未支付";elseif($rs['state']==1) echo "已支付";elseif($rs['state']==2) echo "已发货";elseif($rs['state']==3) echo "已收货";?></td>
                  <td align="center" ><?=date("Y-m-d H:i:s",$rs['addtime'])?></td>
                  <!--<td height="30" align="center" ><a href="order_view.php?id=<?=$rs['id']?>&pageno=<?=$page->pageno?>">查看</a></td>-->
                  </tr>
	<?
  }
  $db->free_result($result);
  ?>
              </table></td>
            </tr>
            
            <tr>
              <td height="30">&nbsp;</td>
            </tr>
             <tr>
					<td height="30" align="right">每页<?=$page->pagesize?>条,第<?=$page->pageno?>/<?=$page->pagenum?>页 共<?=$page->recnum?>条 <a href='?<?=$page->url?>1'>首页</a>   <a href='?<?=$page->url.($page->pageno-1)?>'>上一页</a>  <a href='?<?=$page->url.($page->pageno+1)?>'>下一页</a>   <a href='?<?=$page->url.$page->pagenum?>'>尾页</a></td>
			  </tr>
            <tr>
              <td height="30">&nbsp;</td>
            </tr>
          </table></td>
      </tr>
    </table></td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
      <td height="17" valign="top" background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17" /></td>
    <td background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
        </div>
                  
                  
                  
 <script type="text/javascript" language="javascript"> 
function iFrameHeight() { 
var ifm= document.getElementById("mainfrom"); 
var subWeb = document.frames ? document.frames["mainfrom"].document : ifm.contentDocument; 
if(ifm != null && subWeb != null) { 
ifm.height = subWeb.body.scrollHeight+20; 
} 
} 
  </script>
            </div>
            
<div style="clear:both;"></div>         
<div class="index_footer">
      会员管理系统 版权所有 
</div>
</body>
</html>
